/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pe.edu.upc.dew.sisrest.controller;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import pe.edu.upc.dew.sisrest.model.Menu;
import pe.edu.upc.dew.sisrest.service.MenuManager;

/**
 *
 * @author Aldo
 */
@Controller
public class MenuController {

    MenuManager menuManager;

    @Autowired
    public MenuController(MenuManager omenuManager){
        this.menuManager=omenuManager;
    }

    @RequestMapping("/adm_menues.htm")
    public void adm_menues(Model model, @ModelAttribute("Menu") Menu menu) {
		List<Menu> menues = menuManager.obtenerListaMenus();
                model.addAttribute("menues", menues);
                model.addAttribute("menu", menu);
    }
}
